package com.hkemmm.cola;

public class HourlyEmployee extends ColaEmployee{
    private int hour;       //工作时长
    private double hour_salary;     //时薪

    public HourlyEmployee(String name, int month, int hour_salary) {
        super(name, month);
        this.hour = 0;
        this.hour_salary = hour_salary;
    }


    @Override
    public double getSalary(int month) {        //计算工资方法
        double n = 0;
        if(getMonth() == month){
            n = n + 100;
        }
        if(hour > 160){
            n = n + (hour-160)*1.5*hour_salary + 160*hour_salary;
        }else {
            n = n + hour * hour_salary;
        }

        return  n;
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

    public double getHour_salary() {
        return hour_salary;
    }

    public void setHour_salary(double hour_salary) {
        this.hour_salary = hour_salary;
    }
}
